class Gift {
public:
    int getValue(vector<int> gifts, int n) {
        map<int, int>mp;
        for (const auto& x : gifts) {
            mp[x]++;
        }
        for (const auto& x : mp) {
            if (x.second > n / 2)return x.first;
        }
        return 0;
    }
};